﻿#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <string.h>
#include <math.h>
#include <unordered_map>
using namespace std;

class Solution {
public:
    bool findTargetIn2DPlants(vector<vector<int>>& plants, int target) {
        if (plants.size() == 0) return false;
        int n = plants.size(), m = plants[0].size();
        int si = 0, sj = m - 1;
        while (si < n && sj >= 0)
        {
            if (plants[si][sj] > target) sj--;
            else if (plants[si][sj] < target) si++;
            else return true;
        }
        return false;
    }
};

int main()
{
    return 0;
}